### all

Returns `true` if all elements of the array match the predicate function, otherwise, returns `false`.


```ts
function all<A>(xs: Array<A>, predicateFn: (_1: A) => boolean): boolean
function all<A>(predicateFn: (_1: A) => boolean): (xs: Array<A>) => boolean
```

```ts
A.all(['hello', 'world'], value => value.length > 0) // → true
pipe(
  [1, 2, 3, 4, 5],
  A.all(value => value > 3),
) // → false
```

### any

Returns `true` if at least one of the elements of the array match the predicate function, otherwise, returns `false`.


```ts
function any<A>(xs: Array<A>, predicateFn: (_1: A) => boolean): boolean
function any<A>(predicateFn: (_1: A) => boolean): (xs: Array<A>) => boolean
```

```ts
A.any(['', 'hello', 'world'], value => value.length > 0) // → true
pipe(
  [1, 2, 3, 4, 5],
  A.any(value => value > 5),
) // → false
```

### append

Adds a single element to the end of an array.


```ts
function append<A>(xs: Array<A>, element: A): Array<A>
function append<A>(element: A): (xs: Array<A>) => Array<A>
```

### at

Alias for `get`.


```ts
function at<A>(xs: Array<A>, index: number): Option<A>
function at<A>(index: number): (xs: Array<A>) => Option<A>
```

### concat

Returns a new array containing the concatenation of two provided arrays.


```ts
function concat<A>(xs1: Array<A>): (xs0: Array<A>) => Array<A>
function concat<A>(xs0: Array<A>, xs1: Array<A>): Array<A>
```

### concatMany

Returns a new array as the concatenation of the provided array of arrays.


```ts
function concatMany<A>(xs: Array<Array<A>>): Array<A>
```

### copy

Returns a copy of the provided array.


```ts
function copy<A>(xs: Array<A>): Array<A>
```

### deepFlat

Creates a new array with all sub-array elements concatenated into it recursively up to the `Infinite` depth.


```ts
function deepFlat<A>(xs: Array<A>): Array<ExtractNested<A>>
```

### difference

Returns elements from the first array, not existing in the second array.


```ts
function difference<A>(ys: Array<A>): (xs: Array<A>) => Array<A>
function difference<A>(xs: Array<A>, ys: Array<A>): Array<A>
```

```ts
A.difference([1, 2, 3, 4], [3, 4, 5, 6]) // → [1, 2]
pipe([5, 2, 3, 5, 6], A.difference([5, 2, 3, 1, 5, 4])) // → [6]
```

### drop

Returns a new array that does not contain the first `n` elements of the provided array, or an empty array if `n` is either less than `0` or greater than the length of the provided array.


```ts
function drop<A>(xs: Array<A>, n: number): Array<A>
function drop<A>(n: number): (xs: Array<A>) => Array<A>
```

```ts
A.drop([1], 1) // → []
A.drop([1, 2, 3], 4) // → []
A.drop([1, 2, 3], 2) // → [3]
pipe([1, 2, 3, 4], A.drop(2)) // → [3, 4]
```

### dropExactly

Returns a new array (`Some(xs)`) that does not contain the first `n` elements of the provided array, or `None` if `n` is either less than `0` or greater than the length of the provided array.


```ts
function dropExactly<A>(xs: Array<A>, n: number): Option<Array<A>>
function dropExactly<A>(n: number): (xs: Array<A>) => Option<Array<A>>
```

### dropWhile

Drops elements from the beginning of the array until an element is reached which does not satisfy the given predicate.


```ts
function dropWhile<A>(xs: Array<A>, predicateFn: (_1: A) => boolean): Array<A>
function dropWhile<A>(predicateFn: (_1: A) => boolean): (xs: Array<A>) => Array<A>
```

### eq

Returns `false` if length of both arrays is not the same, otherwise compares elements one by one using the comparator.


```ts
function eq<A>(xs0: Array<A>, xs1: Array<A>, comparatorFn: (_1: A, _2: A) => boolean): boolean
function eq<A>(xs1: Array<A>, comparatorFn: (_1: A, _2: A) => boolean): (xs0: Array<A>) => boolean
```

### every

Returns `true`` if all elements satisfy the given predicate.


```ts
function every<A>(xs: Array<A>, fn: (_1: A) => boolean): boolean
function every<A>(fn: (_1: A) => boolean): (xs: Array<A>) => boolean
```

### filter

Returns a new array that keep all elements satisfy the given predicate.


```ts
function filter<A, B extends A>(xs: Array<A>, predicateFn: (value: A) => value is B): Array<B>
function filter<A, B extends A>(predicateFn: (value: A) => value is B): (xs: Array<A>) => Array<B>
function filter<A>(xs: Array<A>, predicateFn: (value: A) => boolean): Array<A>
function filter<A>(predicateFn: (value: A) => boolean): (xs: Array<A>) => Array<A>
```

```ts
A.filter([1, 2, 3, 4], value => value % 2 === 0) // → [2, 4]
pipe(
  [1, 2, 3, 4, 5, 6, 7, 8, 9],
  A.filter(value => value % 2 === 0),
) // → [2, 4, 6, 8]

pipe(
  ['hello', 'wo', 'rld'],
  A.filter(value => value.length < 4),
) // → ['wo', 'rld']
```

### filterMap

Returns a new array that keep all elements that return `Some(value)` applied within `predicateFn`.


```ts
function filterMap<A, B>(xs: Array<A>, predicateFn: (_1: A) => Option<B>): Array<B>
function filterMap<A, B>(predicateFn: (_1: A) => Option<B>): (xs: Array<A>) => Array<B>
```

```ts
A.filterMap(['', 'hello', 'world', ''], value => {
  return value.length > 0 ? O.Some(value.length) : O.None
}) // → [5, 5]

pipe(
  [1, 2, 3, 4, 5],
  A.filterMap(value => {
    return value % 2 === 0 ? O.Some(value * 2) : O.None
  }),
) // → [4, 8]
```

### filterWithIndex

Returns a new array that keep all elements satisfy the given predicate (which take two arguments: the element for the array and its index).


```ts
function filterWithIndex<A, B extends A>(xs: Array<A>, predicateFn: (index: number, value: A) => value is B): Array<B>
function filterWithIndex<A, B extends A>(predicateFn: (index: number, value: A) => value is B): (xs: Array<A>) => Array<B>
function filterWithIndex<A>(xs: Array<A>, predicateFn: (index: number, value: A) => boolean): Array<A>
function filterWithIndex<A>(predicateFn: (index: number, value: A) => boolean): (xs: Array<A>) => Array<A>
```

### find

Alias for `getBy`.


```ts
function find<A>(xs: Array<A>, predicateFn: (_1: A) => boolean): Option<A>
function find<A>(predicateFn: (_1: A) => boolean): (xs: Array<A>) => Option<A>
```

### flat

Creates a new array with all sub-array elements concatenated into it (the single level depth).


```ts
function flat<A>(xs: Array<A>): Array<A extends Array<infer B> ? B : A>
```

### flip

Returns a new tuple with the reverse order of the elements.


```ts
function flip<A, B>(xs: readonly [A, B]): readonly [B, A]
```

```ts
A.flip([1, 2]) // → [2, 1]
pipe(
  { name: 'Joe', location: 'Warsaw' },
  D.toPairs,
  A.map(A.flip),
  D.fromPairs,
) // → { Joe: 'name', Warsaw: 'location' }
```

### forEach

Calls `fn` on each element of the provided array.


```ts
function forEach<A>(xs: Array<A>, fn: (_1: A) => void): void
function forEach<A>(fn: (_1: A) => void): (xs: Array<A>) => void
```

### forEachWithIndex

Calls `fn` (which takes two arguments: the element from array and its index) on each element of the provided array.


```ts
function forEachWithIndex<A>(xs: Array<A>, fn: (_1: number, _2: A) => void): void
function forEachWithIndex<A>(fn: (_1: number, _2: A) => void): (xs: Array<A>) => void
```

### get

Returns `Some(value)` at the given index, or `None` if the given index is out of range.


```ts
function get<A>(xs: Array<A>, index: number): Option<A>
function get<A>(index: number): (xs: Array<A>) => Option<A>
```

### getBy

Returns `Some(value)` for the first element in the array that satisifies the given predicate function, or `None` if no element satisifies the predicate.


```ts
function getBy<A>(xs: Array<A>, predicateFn: (_1: A) => boolean): Option<A>
function getBy<A>(predicateFn: (_1: A) => boolean): (xs: Array<A>) => Option<A>
```

### getIndexBy

Returns `Some(index)` for the first value in the provided array that satisifies the predicate function.


```ts
function getIndexBy<A>(xs: Array<A>, predicateFn: (_1: A) => boolean): Option<number>
function getIndexBy<A>(predicateFn: (_1: A) => boolean): (xs: Array<A>) => Option<number>
```

### getUndefined

Returns `value` at the given index, or `undefined` if the given index is out of range.


```ts
function getUndefined<A>(xs: Array<A>, index: number): A | undefined
function getUndefined<A>(index: number): (xs: Array<A>) => A | undefined
```

### getUnsafe

Returns `value` at the given index (use only if you're entirely sure that a value exists at the given index).


```ts
function getUnsafe<A>(xs: Array<A>, index: number): A
function getUnsafe<A>(index: number): (xs: Array<A>) => A
```

### groupBy

Splits the given array into sub-arrays in an object, grouped by the result of running each value through the provided function.


```ts
function groupBy<A, B extends PropertyKey>(xs: Array<A>, groupFn: (item: A) => B): Partial<Record<B, readonly [A, ...A[]]>>
function groupBy<A, B extends PropertyKey>(groupFn: (item: A) => B): (xs: Array<A>) => Partial<Record<B, readonly [A, ...A[]]>>
```

### head

Returns `Some(value)` where `value` is the first element of the array, or `None` if the given array is empty.


```ts
function head<A>(xs: Array<A>): Option<A>
```

### includes

Returns `true` if the provided value is equal to at least one element of the given array.


```ts
function includes<A>(xs: Array<A>, value: A): boolean
function includes<A>(value: A): (xs: Array<A>) => boolean
```

### init

Returns a new array (`Some(xs)`) with all elements except the last of the provided array.


```ts
function init<A>(xs: Array<A>): Option<Array<A>>
```

### initOrEmpty

Returns a new array with all elements except the last of the provided array, or an empty array if the given array is empty.


```ts
function initOrEmpty<A>(xs: Array<A>): Array<A>
```

### insertAt

Creates a new array that inserts the given value at the given index (no insertion is made if the index is out of range).


```ts
function insertAt<A>(xs: Array<A>, targetIndex: number, element: A): Array<A>
function insertAt<A>(targetIndex: number, element: A): (xs: Array<A>) => Array<A>
```

### intersection

Returns intersection of two arrays.


```ts
function intersection<A>(ys: Array<A>): (xs: Array<A>) => Array<A>
function intersection<A>(xs: Array<A>, ys: Array<A>): Array<A>
```

```ts
A.intersection([1, 2, 3, 4], [3, 4, 5, 6]) // → [3, 4]
pipe([5, 2, 3, 5, 6], A.intersection([5, 2, 3, 1, 5, 4])) // → [5, 2, 3]
```

### intersperse

Creates a new array with the separator interposed between elements.


```ts
function intersperse<A>(xs: Array<A>, delimiter: A): Array<A>
function intersperse<A>(delimiter: A): (xs: Array<A>) => Array<A>
```

### isEmpty

Determines whether the given array is empty.


```ts
function isEmpty<A>(xs: Array<A>): boolean
```

```ts
A.isEmpty(['hello', 'world']) // → false
A.isEmpty([]) // → true
pipe([1, 2, 3], A.isEmpty) // → false
```

### isNotEmpty

Determines whether the given array is not empty.


```ts
function isNotEmpty<A>(xs: Array<A>): boolean
```

```ts
A.isNotEmpty(['hello', 'world']) // → true
A.isNotEmpty([]) // → false
pipe([1, 2, 3], A.isNotEmpty) // → true
```

### join

Converts each element of the array to a string and concatenates them, separated by the given string.


```ts
function join<A>(xs: Array<A>, delimiter: string): string
function join<A>(delimiter: string): (xs: Array<A>) => string
```

### keep

Alias for `filter`.


```ts
function keep<A, B extends A>(xs: Array<A>, predicateFn: (value: A) => value is B): Array<B>
function keep<A, B extends A>(predicateFn: (value: A) => value is B): (xs: Array<A>) => Array<B>
function keep<A>(xs: Array<A>, predicateFn: (value: A) => boolean): Array<A>
function keep<A>(predicateFn: (value: A) => boolean): (xs: Array<A>) => Array<A>
```

### keepMap

Alias for `filterMap`.


```ts
function keepMap<A, B>(xs: Array<A>, predicateFn: (_1: A) => Option<B>): Array<B>
function keepMap<A, B>(predicateFn: (_1: A) => Option<B>): (xs: Array<A>) => Array<B>
```

### keepWithIndex

Alias for `filterWithIndex`.


```ts
function keepWithIndex<A, B extends A>(xs: Array<A>, predicateFn: (index: number, value: A) => value is B): Array<B>
function keepWithIndex<A, B extends A>(predicateFn: (index: number, value: A) => value is B): (xs: Array<A>) => Array<B>
function keepWithIndex<A>(xs: Array<A>, predicateFn: (index: number, value: A) => boolean): Array<A>
function keepWithIndex<A>(predicateFn: (index: number, value: A) => boolean): (xs: Array<A>) => Array<A>
```

### last

Returns the last element (`Some(value)`) in the array, or `None` if the given array is empty.


```ts
function last<A>(xs: Array<A>): Option<A>
```

### length

Returns the size of the provided array.


```ts
function length<A>(xs: Array<A>): number
```

```ts
A.length(['hello', 'world']) // → 2
pipe([0, 2, 4], A.length) // → 3
```

### make

Returns a new array of size `n` populated by `element`, or an empty array if `n` is negative.


```ts
function make<A>(n: number, element: A): Array<A>
function make<A>(element: A): (n: number) => Array<A>
```

```ts
A.make(-1, 'hello') // → []
A.make(3, 1) // → [1, 1, 1]
pipe(2, A.make('hello')) // → ['hello', 'hello']
```

### makeEmpty

Creates an empty array. Alternative for `const xs = [] as ReadonlyArray<A>`.


```ts
function makeEmpty<A>(): Array<A>
```

```ts
A.makeEmpty<number>() // → []
```

### makeWithIndex

Returns a new array of size `n` populated by `mapFn(index)`, or an empty array if `n` is negative.


```ts
function makeWithIndex<A>(n: number, mapFn: (_1: number) => A): Array<A>
function makeWithIndex<A>(mapFn: (_1: number) => A): (n: number) => Array<A>
```

```ts
A.makeWithIndex(5, index => index * 2) // → [0, 2, 4, 6, 8]
```

### map

Returns a new array by calling `mapFn` for each element of the provided array.


```ts
function map<A, B>(xs: Array<A>, mapFn: (_1: A) => B): Array<B>
function map<A, B>(mapFn: (_1: A) => B): (xs: Array<A>) => Array<B>
```

### mapWithIndex

Returns a new array by calling `mapFn` (which takes two arguments: the element from array and its index) for each element of the provided array.


```ts
function mapWithIndex<A, B>(xs: Array<A>, mapFn: (_1: number, _2: A) => B): Array<B>
function mapWithIndex<A, B>(mapFn: (_1: number, _2: A) => B): (xs: Array<A>) => Array<B>
```

### partition

Splits the provided array into two separate arrays - one containing elements which satisfy the predicate, and the other array containing the elements which do not satisfy the predicate.


```ts
function partition<A, B extends A>(xs: Array<A>, predicateFn: (value: A) => value is B): readonly [Array<B>, Array<Exclude<A, B>>]
function partition<A, B extends A>(predicateFn: (value: A) => value is B): (xs: Array<A>) => readonly [Array<B>, Array<Exclude<A, B>>]
function partition<A>(xs: Array<A>, predicateFn: (value: A) => boolean): readonly [Array<A>, Array<A>]
function partition<A>(predicateFn: (value: A) => boolean): (xs: Array<A>) => readonly [Array<A>, Array<A>]
```

```ts
A.partition([1, 2, 3, 4], value => value > 2) // → [[3, 4],[1, 2]]
pipe([1, 'hello', 2, 'world'], A.partition(G.isString)) // → [['hello', 'world'], [1, 2]]
```

### prepend

Prepends a single element to the start of the given array.


```ts
function prepend<A>(xs: Array<A>, element: A): Array<A>
function prepend<A>(element: A): (xs: Array<A>) => Array<A>
```

### prependToAll

Returns a new array which contains the given delimiter inserted before every element in the provided array.


```ts
function prependToAll<A>(xs: Array<A>, delimiter: A): Array<A>
function prependToAll<A>(delimiter: A): (xs: Array<A>) => Array<A>
```

### range

Returns a new inclusive array of numbers from `start` to `finish` (it returns an empty array when `start` > `finish`).


```ts
function range(finish: number): (start: number) => Array<number>
function range(start: number, finish: number): Array<number>
```

### rangeBy

Returns a new inclusive array of numbers from `start` to `finish` (it returns an empty array when `step` is 0 or negative, it also returns an empty array when `start` > `finish`).


```ts
function rangeBy(finish: number, step: number): (start: number) => Array<number>
function rangeBy(start: number, finish: number, step: number): Array<number>
```

### reduce

Applies `reduceFn` (which has two parameters: an `accumulator` which starts with a value of `initialValue` and the next value from the array) to each element of the provided array, and eventually it returns the final value of the accumulator.


```ts
function reduce<A, B>(xs: Array<A>, initialValue: B, reduceFn: (_1: B, _2: A) => B): B
function reduce<A, B>(initialValue: B, reduceFn: (_1: B, _2: A) => B): (xs: Array<A>) => B
```

### reduceReverse

Works like A.reduce, except that the function `reduceFn` is applied to each item of `xs` from the last back to the first.


```ts
function reduceReverse<A, B>(xs: Array<A>, initialValue: B, reduceFn: (_1: B, _2: A) => B): B
function reduceReverse<A, B>(initialValue: B, reduceFn: (_1: B, _2: A) => B): (xs: Array<A>) => B
```

### reduceWithIndex

Applies `reduceFn` (which has three parameters: an `accumulator` which starts with a value of `initialValue`, the next value from the array and its index) to each element of the provided array, and eventually it returns the final value of the accumulator.


```ts
function reduceWithIndex<A, B>(xs: Array<A>, initialValue: B, reduceFn: (_1: B, _2: A, _3: number) => B): B
function reduceWithIndex<A, B>(initialValue: B, reduceFn: (_1: B, _2: A, _3: number) => B): (xs: Array<A>) => B
```

### reject

Returns a new array of elements from the provided array which do not satisfy the given predicate.


```ts
function reject<A>(xs: Array<A>, predicateFn: (_1: A) => boolean): Array<A>
function reject<A>(predicateFn: (_1: A) => boolean): (xs: Array<A>) => Array<A>
```

### rejectWithIndex

Returns a new array of elements from the provided array which do not satisfy the given predicate (which take two arguments: the element for the array and its index).


```ts
function rejectWithIndex<A>(xs: Array<A>, predicateFn: (_1: number, _2: A) => boolean): Array<A>
function rejectWithIndex<A>(predicateFn: (_1: number, _2: A) => boolean): (xs: Array<A>) => Array<A>
```

### removeAt

Creates a new array without the element at the given index (the original array if the index is out of range).


```ts
function removeAt<A>(xs: Array<A>, targetIndex: number): Array<A>
function removeAt<A>(targetIndex: number): (xs: Array<A>) => Array<A>
```

### removeFirst

Creates a copy of the given array with the first occurrence of the given element removed


```ts
function removeFirst<A>(xs: Array<A>, value: A): Array<A>
function removeFirst<A>(value: A): (xs: Array<A>) => Array<A>
```

```ts
A.removeFirst(['hello', 'hello', 'world'], 'hello') // → ['hello', 'world']
pipe([4, 5, 2, 1, 3], A.removeFirst(1)) // → [4, 5, 2, 3]
```

### removeFirstBy

Removes the first occurrence of the given value from the array, using the given equality function.


```ts
function removeFirstBy<A, B>(xs: Array<A>, value: B, predicateFn: (_1: A, _2: B) => boolean): Array<A>
function removeFirstBy<A, B>(value: B, predicateFn: (_1: A, _2: B) => boolean): (xs: Array<A>) => Array<A>
```

```ts
A.removeFirstBy([1, 2, 1, 3, 4], 2, N.gt) // → [1, 2, 1, 4]
pipe(
  ['hello', 'wrld', 'world'],
  A.removeFirstBy(4, (str, length) => str.length === length),
) // → ['hello', 'world']
```

### repeat

Alias for `make`.


```ts
function repeat<A>(n: number, element: A): Array<A>
function repeat<A>(element: A): (n: number) => Array<A>
```

### replaceAt

Creates a new array by replacing the value at the given index with the given value (no replacement is made if the index is out of range).


```ts
function replaceAt<A>(xs: Array<A>, targetIndex: number, element: A): Array<A>
function replaceAt<A>(targetIndex: number, element: A): (xs: Array<A>) => Array<A>
```

### reverse

Returns a new array with the elements of the provided array in reverse order.


```ts
function reverse<A>(xs: Array<A>): Array<A>
```

```ts
A.reverse([1, 2, 3, 4, 5]) // → [5, 4, 3, 2, 1]
pipe(['hello', 'world'], A.reverse) // → ['world', 'hello']
```

### shuffle

Returns a new array with elements in the original array randomly shuffled.


```ts
function shuffle<A>(xs: Array<A>): Array<A>
```

### slice

Returns a new array with the `len` elements of the given array starting at `offset` (offset can be negative).


```ts
function slice<A>(xs: Array<A>, offset: number, len: number): Array<A>
function slice<A>(offset: number, len: number): (xs: Array<A>) => Array<A>
```

### sliceToEnd

Returns a new array with the elements of the given array starting at `offset` (offset can be negative).


```ts
function sliceToEnd<A>(xs: Array<A>, offset: number): Array<A>
function sliceToEnd<A>(offset: number): (xs: Array<A>) => Array<A>
```

### some

Returns `true` if at least one of the elements in the given array satifies the predicate.


```ts
function some<A>(xs: Array<A>, fn: (_1: A) => boolean): boolean
function some<A>(fn: (_1: A) => boolean): (xs: Array<A>) => boolean
```

### sort

Returns a new array, sorted according to the comparator function.


```ts
function sort<A>(xs: Array<A>, sortFn: (_1: A, _2: A) => number): Array<A>
function sort<A>(sortFn: (_1: A, _2: A) => number): (xs: Array<A>) => Array<A>
```

### sortBy

Returns a new array, sorted according to the provided function.


```ts
function sortBy<A, B>(xs: Array<A>, sortFn: (_1: A) => B): Array<A>
function sortBy<A, B>(sortFn: (_1: A) => B): (xs: Array<A>) => Array<A>
```

### splitAt

Returns two arrays (`Some([xs, ys])`), with the original array divided at the given index, or `None` if the index is out of range.


```ts
function splitAt<A>(xs: Array<A>, offset: number): Option<readonly [Array<A>, Array<A>]>
function splitAt<A>(offset: number): (xs: Array<A>) => Option<readonly [Array<A>, Array<A>]>
```

### splitEvery

Returns an array of arrays, where each of the inner arrays has length equal to the provided `size` parameter.


```ts
function splitEvery<A>(xs: Array<A>, size: number): Array<Array<A>>
function splitEvery<A>(size: number): (xs: Array<A>) => Array<Array<A>>
```

### swapAt

Creates a new array with the elements at the two given indexes swapped (the original array if the index is out of range).


```ts
function swapAt<A>(xs: Array<A>, targetIndex: number, swapIndex: number): Array<A>
function swapAt<A>(targetIndex: number, swapIndex: number): (xs: Array<A>) => Array<A>
```

### tail

Returns a new array containing all but the the first element of the provided array, or `None` if the given array is empty (has no tail).


```ts
function tail<A>(xs: Array<A>): Option<Array<A>>
```

```ts
A.tail([1, 2, 3]) // → Some([2, 3])
A.tail([1]) // → Some([])
A.tail([]) // → None
pipe([1, 2, 3, 4], A.tail) // → Some([2, 3, 4])
```

### tailOrEmpty

Returns a new array containing all but the first element of the provided array, or an empty array if the given array is empty (has no tail).


```ts
function tailOrEmpty<A>(xs: Array<A>): Array<A>
```

### take

Returns a new array including the first `n` elements of the provided array, or an empty array if `n` is either negative or greater than the length of the provided array.


```ts
function take<A>(xs: Array<A>, n: number): Array<A>
function take<A>(n: number): (xs: Array<A>) => Array<A>
```

### takeExactly

Returns a new array (`Some(xs)`) with the first `n` elements of the provided array, or `None` if `n` is either negative or greater than the length of the provided array.


```ts
function takeExactly<A>(xs: Array<A>, n: number): Option<Array<A>>
function takeExactly<A>(n: number): (xs: Array<A>) => Option<Array<A>>
```

### takeWhile

Returns a new array, filled with elements from the provided array until an element doesn't pass the provided predicate.


```ts
function takeWhile<A>(xs: Array<A>, predicateFn: (_1: A) => boolean): Array<A>
function takeWhile<A>(predicateFn: (_1: A) => boolean): (xs: Array<A>) => Array<A>
```

### tap

Applies a side-effect function on each element of the provided array.


```ts
function tap<A>(xs: Array<A>, fn: (_1: A) => void): Array<A>
function tap<A>(fn: (_1: A) => void): (xs: Array<A>) => Array<A>
```

### toTuple

Converts the given array to the TypeScript's tuple.


```ts
function toTuple<T extends Array<any>>(xs: readonly [...T]): readonly [...T]
```

### uncons

Splits the provided array into head and tail parts (as a tuple), but only if the array is not empty.


```ts
function uncons<A>(xs: Array<A>): Option<readonly [A, Array<A>]>
```

### union

Returns union of two arrays.


```ts
function union<A>(ys: Array<A>): (xs: Array<A>) => Array<A>
function union<A>(xs: Array<A>, ys: Array<A>): Array<A>
```

```ts
A.union([1, 2, 3, 4], [3, 4, 5, 6]) // → [1, 2, 3, 4, 5, 6]
pipe([5, 2, 3, 5, 6], A.union([5, 2, 3, 1, 5, 4])) // → [5, 2, 3, 6, 1, 4]
```

### uniq

Returns a new array containing only one copy of each element in the provided array.


```ts
function uniq<A>(xs: Array<A>): Array<A>
```

```ts
A.uniq([1, 2, 2, 3, 4, 4, 5, 6]) // → [1, 2, 3, 4, 5, 6,]
A.uniq([[1, 2], [2, 1], [1, 2], [3, 4]]) // → [[1, 2], [2, 1], [3, 4]]

A.uniq([
  { name: 'John', age: 20 },
  { name: 'Emily', age: 30 },
  { name: 'John', age: 20 },
]) // → [{ name: 'John', age: 20 }, { name: 'Emily', age: 30 }]

pipe([1, 2, 2, 3, 4, 4, 5, 6], A.uniq) // → [1, 2, 3, 4, 5, 6,]
```

### uniqBy

Returns a new array containing only one copy of each element in the provided array, based upon the value returned by applying the function to each element.


```ts
function uniqBy<A, B>(xs: Array<A>, uniqFn: (_1: A) => B): Array<A>
function uniqBy<A, B>(uniqFn: (_1: A) => B): (xs: Array<A>) => Array<A>
```

```ts
A.uniqBy([1, 2, 2, 3, 4, 4, 5, 6], F.identity) // → [1, 2, 3, 4, 5, 6,]
A.uniqBy(
  [
    { name: 'Joe', age: 20 },
    { name: 'John', age: 20 },
  ],
  user => user.age,
) // → [{ name: 'Joe', age: 20 }]

pipe([1, 2, 2, 3, 4, 4, 5, 6], A.uniqBy(F.identity)) // → [1, 2, 3, 4, 5, 6,]
```

### unzip

Takes an array of pairs and creates a pair of arrays. The first array contains all the first elements of the pairs and the other one contains all the second elements.


```ts
function unzip<A, B>(xs: Array<readonly [A, B]>): readonly [Array<A>, Array<B>]
```

### updateAt

Creates a new array that replaces the value at the given index with the value returned by the provided function (the original array if the index is out of range).


```ts
function updateAt<A>(xs: Array<A>, targetIndex: number, fn: (_1: A) => A): Array<A>
function updateAt<A>(targetIndex: number, fn: (_1: A) => A): (xs: Array<A>) => Array<A>
```

### zip

Creates a new array of pairs from corresponding elements of two provided arrays.


```ts
function zip<A, B>(xs1: Array<B>): (xs0: Array<A>) => Array<readonly [A, B]>
function zip<A, B>(xs0: Array<A>, xs1: Array<B>): Array<readonly [A, B]>
```

### zipWith

Creates a new array by applying `zipFn` to corresponding elements of two provided arrays.


```ts
function zipWith<A, B, C>(xs0: Array<A>, xs1: Array<B>, zipFn: (_1: A, _2: B) => C): Array<C>
function zipWith<A, B, C>(xs1: Array<B>, zipFn: (_1: A, _2: B) => C): (xs0: Array<A>) => Array<C>
```

### zipWithIndex

Creates a new array of each value paired with its index in a tuple.


```ts
function zipWithIndex<A>(xs: Array<A>): Array<readonly [A, number]>
```

```ts
A.zipWithIndex(['hello', 'world']) // → [['hello', 0], ['world', 1]]
```